]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
altTab: Only calculate iconSize once
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 25 Apr 2018 23:36:41 +0000 (01:36 +0200)
committerMarge Bot <marge-bot@gnome.org>
Tue, 25 Jan 2022 20:03:01 +0000 (20:03 +0000)
Right now, _setIconSize() calculates the icon size everytime the
preferred height of AppSwitcher is calculated, which happens quite
often.

Reduce the perfomance impact by only calculating the icon size once.
This has the added benefit of preventing unexpected changes to the icon
sizes while the switcher is open.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2098>

js/ui/altTab.js

index e7886e4f1ecd8466bc1db03936786e413954bafa..78450ac7898598fb811103c115efc7c28aa9d840 100644 (file)
@@ -765,7 +765,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
     }
 
     vfunc_get_preferred_height(forWidth) {
-        this._setIconSize();
+        if (!this._iconSize)
+            this._setIconSize();
+
         return super.vfunc_get_preferred_height(forWidth);
     }